<!doctype html>
<html lang="zh-hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<!-- css -->
<link rel="stylesheet" href='<?=base_url().'resource/lib/bootstrap/css/bootstrap.min.css'?>'>
<?php if ($showdebug==false): ?>
<link rel="stylesheet" href='<?=base_url().'resource/css/debug.css'?>'>
<?php endif; ?>
<!-- js -->
<script src='<?=base_url().'resource/lib/bootstrap/jquery-2.1.1.min.js'?>'></script>
<script src='<?=base_url().'resource/lib/bootstrap/js/bootstrap.min.js'?>'></script>

<title>首页</title>

<script>
/* openId and state 如果不存在则缓存 */
window.onload = function() { 

	var session_openId=sessionStorage.getItem("openId");
	if (session_openId == null || session_openId == undefined || session_openId == '') { 
		sessionStorage.setItem("openId", "<?=isset($openId)?$openId:'';?>"); 
// 		alert("save openId:"+session_openId);
	} 	

	var session_state=sessionStorage.getItem("state");
	if (session_state == null || session_state == undefined || session_state == '') { 
		sessionStorage.setItem("state", "<?=isset($state)?$state:'';?>"); 
	} 
	
// 	alert(sessionStorage.getItem("openId"));						// test 
}


</script> 
 
</head>
<body>
<div class="container">
<div class="row">

<input type="text"  name="openId" id="myOpenId"  value="">
<input type="text"  name="state" id="myState"  value="">

<header id="myheader">
<p><?php echo isset($user['name'])?$user['name']:'';?>您好!欢迎加入西部挖掘机经纪人联盟</p>
</header>



<!--  
<section id="mylogo">
<img alt="140x140" class="img-circle img-responsive center-block" data-src="holder.js/140x140" style="width: 140px; height: 140px;" src="" data-holder-rendered="true">
</section>
-->

<?php if ($state==-1): ?>
<section id="mybody_2">
<div class="jumbotron">
<p><h3>赶紧注册经纪人吧 !</h3></p>
<p><h3>丰厚佣金等着您哟 : )</h3></p>
<p><a class="btn btn-warning btn-lg" href="#" role="button" onClick="tijiao(1)" >我要注册</a></p>
</div>
</section>
<?php endif; ?>

<?php if ($state==1): ?>
<section id="mybody_1">
<div class="jumbotron">
<p><h3>赶紧推荐客户吧 !</h3></p>
<p><h3>丰厚佣金等着您哟 : )</h3></p>
<p><a class="btn btn-warning btn-lg" href="#" role="button" onClick="tijiao(2)" >我要推荐</a></p>
</div>
</section>
<?php endif; ?>



<?php if ($state==0): ?>
<section id="mybody_3">
<div class="jumbotron">
<p><h3>感谢您加入组织</h3></p>
<p><h3>正在加紧审核中...</h3></p>
<p><a class="btn btn-primary btn-lg" href="#" role="button" onclick="WeixinJSBridge.call('closeWindow');" >关闭</a></p>
</div>
</section>
<?php endif; ?>

<?php if ($state==2): ?>
<section id="mybody_3">
<div class="jumbotron">
<p><h3>您的账号已经暂停</h3></p>
<p><a class="btn btn-primary btn-lg" href="#" role="button" onclick="WeixinJSBridge.call('closeWindow');" >关闭</a></p>
</div>
</section>
<?php endif; ?>

<?php if ($state==1): ?>
<section id="footer">
<div id="_buttom_menu" class="navbar-fixed-bottom">
<div class="col-xs-3"><button type="button" class="btn btn-default" onClick="tijiao(3)">回到首页</button></div>
<div class="col-xs-3"><button type="button" class="btn btn-default" onClick="tijiao(2)">推荐客户</button></div>
<div class="col-xs-3">
<div class="btn-group dropup">
<button type="button" class="btn btn-default dropdown-toggle" 
data-toggle="dropdown">
个人中心<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#" onClick="tijiao(4)">我的信息</a></li>
<li><a href="#" onClick="tijiao(5)">我的客户</a></li>
</ul>
</div>    
</div>
<div class="col-xs-3"><button type="button" class="btn btn-default">。。。</button></div>
</div>
</section>
<?php endif; ?>









<!--  <div id="footer" class="navbar-fixed-bottom"> 
<div class="col-xs-3"><button type="button" class="btn btn-info">回到首页</button></div> 
<div class="col-xs-3"><button type="button" class="btn btn-info">推荐客户</button></div> 
<div class="col-xs-3"><button type="button" class="btn btn-info">管理客户</button></div> 
<div class="col-xs-3"><button type="button" class="btn btn-info">个人信息</button></div>  -->



</div>
</div>
</body>
</html>